package com.qingdai.commoditycenter.config;

import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class RequestConfig {
    @Value("${server.servlet.context-path}")
    private String contextPath;
    public boolean check(HttpServletRequest request){
        String requestURI = request.getRequestURI();
        if (requestURI.equals(contextPath + "/login") || requestURI.equals(contextPath + "/userLogin")
                || requestURI.startsWith(contextPath + "/swagger-ui") || requestURI.startsWith(contextPath + "/user/")
                || requestURI.startsWith(contextPath + "/v3"))
        {
            return true;
        }else {
            return false;
        }
    }
}
